import 'package:flutter/material.dart';
import '../widgets/CircleImage.dart';
import '../widgets/form/DDSearchField.dart';
import '../widgets/CircleImageAndText.dart';
import '../widgets/CircleIconAndText.dart';
import '../widgets/RatingBar.dart';

class CustomWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => new CustomWidgetState();
}

class CustomWidgetState extends State<CustomWidget> {
  @override
  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(
          centerTitle: true,
          title: new Text("测试页面"),
          iconTheme: new IconThemeData(color: Colors.white),
          // leading: new Icon(Icons.chevron_left, size: 40.0, color: Colors.white,),
          actions: <Widget>[
            new IconButton(
              icon: new Icon(Icons.more_vert, size: 40.0, color: Colors.white),
              onPressed: () {
                Navigator.of(context).pushNamed("/lms/score");
              },
            ),
            
          ],
        ),
        body: new Center(
          child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              new Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  new CircleImage(
                    width: 50.0,
                    height: 50.0,
                    path: "http://c.hiphotos.baidu.com/image/pic/item/b64543a98226cffc2c824855b5014a90f703eaa9.jpg",
                    type: CircleImageType.network,
                  ),
                  new CircleImage(
                    width: 50.0,
                    height: 50.0,
                    path: "assets/bg/cover_img.jpg",
                    type: CircleImageType.asset,
                  ),
                ]
              ),

              new DDSearchField('请输入关键字'),
              new Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  new CircleImageAndText("assets/bg/cover_img.jpg", "全部"),
                  new Padding(padding: new EdgeInsets.all(10.0),),
                  new CircleImageAndText("assets/bg/cover_img.jpg", "全部", width: 80.0, height: 80.0,),
                ],
              ),
              new Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  new CircleIconAndText(Icons.book, "书籍", Colors.red, onPressed: () => print("书籍")),
                  new Padding(padding: new EdgeInsets.all(10.0),),
                  new CircleIconAndText(Icons.star_half, "半星", Colors.blue, size: 80.0, onPressed: () => print("半星")),
                ],
              ),/*
              new Container(
                padding: new EdgeInsets.symmetric(horizontal: 10.0),
                child: new Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    new Icon(Icons.star_border, size: 50.0, color: Colors.orangeAccent,),
                    new Icon(Icons.star_border, size: 50.0, color: Colors.orangeAccent,),
                    new Icon(Icons.star_border, size: 50.0, color: Colors.orangeAccent,),
                    new Icon(Icons.star_border, size: 50.0, color: Colors.orangeAccent,),
                    new Icon(Icons.star_border, size: 50.0, color: Colors.orangeAccent,),
                  ],
                ),
              ),*/
              new RatingBar(),
              new RatingBar(
                countRate: 4,
                color: Colors.blueAccent,
              ),
              new RatingBar(
                maxRate: 10, 
                countRate: 8,
                size: 20.0,
                spacing: 3.0,
                color: Colors.redAccent,
              ),
            ],
          ),
        ));
  }
}
